import { Form, Field ,Button} from 'react-vant';

export default () => {
  const [form] = Form.useForm();

  const onFinish = (values) => {
        if (values.username == "123" && values.password == "123") {
            window.localStorage.setItem("isLogin","true")
        } else {
            window.localStorage.setItem("isLogin","false")
        } 
  };

  return (
    <Form onFinish={onFinish} form={form}  footer={
        <div style={{ margin: '16px 16px 0' }}>
          <Button round nativeType="submit" type="primary" block>
            提交
          </Button>
        </div>
      }
    >
      <Form.Item name="username" label="用户名">
      <Field />
      </Form.Item>
      <Form.Item name="password" label="密码">
      <Field /> 
      </Form.Item>
    </Form>
  );
};